package com.crm.model.vo.opportunityManager;

import lombok.Data;

import java.math.BigDecimal;

@Data
public class PerformanceRankingVO implements Comparable<PerformanceRankingVO> {

    private String accountId; //用户id

    private String companyId; //公司id

    private String companyName; //公司名称

    private BigDecimal contractActualTotalAmount;  //业绩金额

    private String createPeopleId; //用户id

    private String userName; //用户名称

    private String count;  //联系人数

    private String accessUrl;  //头像

    private String arriveTime;  //到款时间

    private String rowNum; //排名

    @Override
    public int compareTo(PerformanceRankingVO o) {
        if (o.getContractActualTotalAmount() == null && contractActualTotalAmount == null) {
            return 0;
        } else if (o.getContractActualTotalAmount() == null) {
            return -1;
        } else if (contractActualTotalAmount == null) {
            return 1;
        }
        return o.getContractActualTotalAmount().compareTo(contractActualTotalAmount);
    }


}
